	<!DOCTYPE html>
	<html lang="en">
	<head>
		<meta charset="UTF-8">
		<title>dom第一天</title>
	</head>
	<body>
		<input type="button" value="我是按钮" id="inp" onclick="onBtn()">
		<button id="btn">我是按钮1</button>
		<script>
	// document.getElementById('inp').onclick=function(){
	// 	alert("我被点击了")

	// }
	// document.getElementById('btn').onclick = function(){
	// 	alert(2)
	// }
	function onBtn(){
		alert(1)
	}
</script>

<input type="button" value="我是按钮2" id="btn2">
<script>
	function fn(){
		alert(1)
	}
	var btnObj = document.getElementById('btn2');
	btnObj.onclick = function(){
		fn();
	}
</script>
</body>
</html>